package subject_set.interview.Day11_23_nanjin;

/**
 * @author haomin
 * @date 2022/11/23 17:26
 **/
public class Test {
    public static int fun(int n) {
        if(n == 1 || n == 2) {
            return 1;
        }
        return fun(n-1) + fun(n-2);
    }
    public static void fun2(int n) {
        if(n == 1) {
            System.out.println(1);
            return;
        }
        if(n == 2) {
            System.out.println(1);
            System.out.println(1);
            return;
        }
        System.out.println(1);
        System.out.println(1);
        int a = 1, b = 1;
        int c = 2;
        int count = 3;
        while(count <= n) {
            c = a + b;
            System.out.println(c);
            a = b;
            b = c;
            count++;
        }
        return;
    }

    public static void main(String[] args) {
        fun2(5);
    }

}